package org.dashboard.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import org.dashboard.bean.AdFolder;
import org.dashboard.constant.Constant;
import org.dashboard.dao.AdFolderMapper;
import org.dashboard.service.AdFolderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;

import java.util.List;

@Service(interfaceClass = AdFolderService.class)
@CacheConfig(cacheManager = Constant.DEFAULT_CACHE_MANAGER)
public class AdFolderServiceImpl implements AdFolderService {
    private static final Logger logger = LoggerFactory.getLogger(AdFolderServiceImpl.class);

    @Autowired
    private AdFolderMapper adFolderMapper;

    @Override
    public int insert(AdFolder record) {
        adFolderMapper.insert(record);
        return record.getFolderId();
    }

    @Override
    public int insertSelective(AdFolder record) {
        adFolderMapper.insertSelective(record);
        return record.getFolderId();
    }

    @Override
    public int updateByPrimaryKey(AdFolder record) {
        return adFolderMapper.updateByPrimaryKey(record);
    }

    @Override
    public int deleteByPrimaryKey(Integer folderId) {
        return adFolderMapper.deleteByPrimaryKey(folderId);
    }

    @Override
    public AdFolder selectByPrimaryKey(Integer folderId) {
        return adFolderMapper.selectByPrimaryKey(folderId);
    }

    @Override
    public int updateByPrimaryKeySelective(AdFolder record) {
        return adFolderMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public List<AdFolder> selectAdFoldersByType(Integer folderType) {
        return adFolderMapper.selectAdFoldersByType(folderType);
    }

    @Override
    public AdFolder selectAdFolderByFolderName(String folderName) {
        return adFolderMapper.selectAdFolderByFolderName(folderName);
    }

}
